const xlsx = require("node-xlsx");
const path = require("path");
const uuid = require("uuid");

const team = require("../Team")

// 导入部门
const teamData = xlsx.parse(path.join( __dirname, "..", "..", "xlsx", "team.xlsx" ))[0].data;
const arr = [];
for(let i=1; i<teamData.length; i++){
  arr.push({
    tId: 'team-'+uuid.v1(),
    tName: teamData[i][0]
  })
}
team.insertMany( arr ).then(()=>{
  console.log('部门导入成功');
})